package Homework.work4;

import java.util.Scanner;

//输入3个数,按大小输出这3个数（例如：用户输入的是：10  5  20  ，排序后为：5 10 20）
// （备注：只能使用三个变量，而且只能使用if的嵌套）
public class Number {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("输入第一个数a");
        int a=scanner.nextInt();
        System.out.println("输入第二个数b");
        int b=scanner.nextInt();
        System.out.println("输入第三个数c");
        int c=scanner.nextInt();
        if (a<b&&b<c){
            System.out.println(a + "  " + b + "  " + c);
        }else if (c<b&&b<a){
            System.out.println(c + "  " + b + "  " + a);
        }else if (a<c&&c<b) {
            System.out.println(a + "  " + c + "  " + b);
        }else if (b<c&&c<a) {
            System.out.println(b + "  " + c + "  " + a);
        }else if (b<a&&a<c) {
            System.out.println(b + "  " + a + "  " + c);
        }else if (c<a&&a<b) {
            System.out.println(c + "  " + a + "  " + b);
        }
    }
}
